<!doctype html>
<html>

	<head>
		<title>Crontab UI</title>
		<meta charset="UTF-8" />
		<script src="/static/js/jquery.js"></script>
		<script src="/static/js/script.js"></script>
		<script src="/static/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
	</head>

	<body>
		<nav class="navbar navbar-default">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<span class="navbar-brand">任务</span>
				</div>
				<div class="navbar-header">
					<span class="navbar-brand"><a href='/Log' target='_blank'>日志</a></span>
				</div>
			</div>
			<!-- /.container-fluid -->
		</nav>
		<div class="container">
			<h2>Cronjobs</h2>
			<br/>
			<br/>
			<button class='btn'><a href='/clearqueue'><span>清空队列</span></a></button>
			<table class="table">
				<tr>
					<th>name</th>
					<th>说明</th>
					<th>下次执行时间</th>
					<th></th>
				</tr>
				<tr>
					<td>定时读取</td>
					<td>新增号码</td>
					<td> {{job1.next_run_time}} </td>
					<td><a class="btn btn-primary" onclick="editJob('INTERVAL', '{{job1.id}}','{{job1.kwargs}}')"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Edit</a></td>
				</tr>
				<tr>
					<td>每日定时</td>
					<td>重复查询号码</td>
					<td>{{job2.next_run_time}}</td>
					<td><a class="btn btn-primary" onclick="editJob('DAY','{{job2.id}}','{{job2.kwargs}}')"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Edit</a></td>
				</tr>

			</table>
		</div>
		<div class="modal fade" id="popup">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="modal-title">Message</h4>
					</div>
					<div class="modal-body" id="modal-body">
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal" id="modal-close-button">Close</button>
						<button type="button" class="btn btn-primary" data-dismiss="modal" id="modal-button">Ok</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal-dialog -->
		</div>
		<!-- /.modal -->

		<div class="modal fade" id="info-popup">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="info-title">Message</h4>
					</div>
					<div class="modal-body" id="info-body">
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" data-dismiss="modal" id="info-button">Ok</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal-dialog -->
		</div>
		<!-- /.modal -->

		<!-- Job -->
		<div class="modal fade" id="job">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="job-title">Job</h4>
					</div>
					<div class="modal-body" id="job-body">

						<div class="row">
							<div class="col-md-2">分</div>
							<div class="col-md-2">时</div>
							<div class="col-md-2">间隔天数</div>
							<div class="col-md-2">首次记录时间与当前时间相差天数以内且有搜索结果</div>
							<div class="col-md-2">搜索时间与当前时间超过天数且monactive为1</div>
						</div>
						<div class="row">
							<div class="col-md-2">
								<input type="text" class="form-control" id="job-minute" value="*" onclick="this.select();" />
							</div>
							<div class="col-md-2">
								<input type="text" class="form-control" id="job-hour" value="*" onclick="this.select();" />
							</div>
							<div class="col-md-2">
								<input type="text" class="form-control" id="job-day" value="*" onclick="this.select();" />
							</div>
							<div class="col-md-2">
								<input type="text" class="form-control" id="job-limit" value="*" onclick="this.select();" />
							</div>
							<div class="col-md-2">
								<input type="text" class="form-control" id="job-exceed" value="*" onclick="this.select();" />
							</div>
						</div>

						<br />
						<br />
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
						<button type="button" class="btn btn-primary" data-dismiss="modal" id="job-save">Save</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal-dialog -->
		</div>
		<!-- /.modal -->
	</body>

</html>